package com.tangji.signaltower.enums;

/**
 * Created with IntelliJ IDEA.
 * User: Amarendar
 * Date: 2020/6/15
 * Time: 下午5:51
 */
public enum SubscriptionEnum {

    //数字货币
    BTCUSD("C_BTC_USD", "BINANCE:BTCUSDT", "BTC-USD", ""),//ok
    BCHUSD("C_BCH_USD", "BCHUSD", "BCH-USD", ""),//ok
    ETHUSD("C_ETH_USD", "ETHUSD", "ETH-USD", ""),//ok
    XRPUSD("C_XRP_USD", "XRPUSD", "XRP-USD", ""),//ok
//    EURUSD("EURUSD", "EURUSD", "", ""),
//    GBPUSD("GBPUSD", "GBPUSD", "", ""),
//    EURJPY("EURJPY", "EURJPY", "", ""),
//    XAUUSD("XAUUSD", "XAUUSD", "", ""),
//    XAGUSD("XAGUSD", "XAGUSD", "", ""),
//    MARKETS("MARKETS", "IC MARKETS:1", "", ""),

    //汇率
    GBP_USD("F_GBP_USD", "", "GBP/USD", ""),//ok
    EUR_CAD("F_EUR_CAD", "", "EUR/CAD", ""),//ok
    GBP_AUD("F_GBP_AUD", "", "GBP/AUD", ""),//ok
    EUR_USD("F_EUR_USD", "", "EUR/USD", ""),//ok
    GBP_CAD("F_GBP_CAD", "", "GBP/CAD", ""),//ok
    GBP_NZD("F_GBP_NZD", "", "GBP/NZD", ""),//ok
    EUR_AUD("F_EUR_AUD", "", "EUR/AUD", ""),//ok
    GBP_JPY("F_GBP_JPY", "", "GBP/JPY", ""),//ok
    EUR_JPY("F_EUR_JPY", "", "EUR/JPY", ""),//ok
    INR_USD("F_INR_USD", "", "INR/USD", ""),//ok
    JPY_USD("F_JPY_USD", "", "JPY/USD", ""),//ok
    AUD_USD("F_AUD_USD", "", "AUD/USD", ""),//ok
    AUD_EUR("F_AUD_EUR", "", "AUD/EUR", ""),//ok
    ;

    private String type;

    private String finnhubType; //外部类型

    private String polygonType; //外部类型

    private String desc;

    SubscriptionEnum(String type, String finnhubType, String polygonType, String desc) {
        this.type = type;
        this.finnhubType = finnhubType;
        this.polygonType = polygonType;
        this.desc = desc;
    }

    public String getType() {
        return type;
    }

    public SubscriptionEnum setType(String type) {
        this.type = type;
        return this;
    }

    public String getFinnhubType() {
        return finnhubType;
    }

    public SubscriptionEnum setFinnhubType(String finnhubType) {
        this.finnhubType = finnhubType;
        return this;
    }

    public String getPolygonType() {
        return polygonType;
    }

    public SubscriptionEnum setPolygonType(String polygonType) {
        this.polygonType = polygonType;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public SubscriptionEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static SubscriptionEnum getEnum(String type) {
        SubscriptionEnum statusEnums = null;
        for (SubscriptionEnum e : SubscriptionEnum.values()) {
            if (e.getType().equals(type)) {
                statusEnums = e;
            }
        }
        return statusEnums;
    }

    public static SubscriptionEnum getEnumByFinnhubType(String finnhubType) {
        SubscriptionEnum statusEnums = null;
        for (SubscriptionEnum e : SubscriptionEnum.values()) {
            if (e.getFinnhubType().equals(finnhubType)) {
                statusEnums = e;
                break;
            }
        }
        return statusEnums;
    }

    public static SubscriptionEnum getEnumByPolygonType(String polygonType) {
        SubscriptionEnum statusEnums = null;
        for (SubscriptionEnum e : SubscriptionEnum.values()) {
            if (e.getPolygonType().equals(polygonType)) {
                statusEnums = e;
                break;
            }
        }
        return statusEnums;
    }
}
